function choose_hospital(id,name) {
        $('.searchData').hide();
        $('#hospital_info').val(name);
        $('#hospitalid').val(id);
        console.log(id,name);
    }

    function searchList(param){
        hName = $("#hospital_info").val()
        $.ajax({
            type: 'get',
            url: "/api/zone/hospitals",
            dataType:'json',
            data: {
                name:hName
            },
            success:function(res){

                if(res.data && res.data.length != 0){
                    console.log(res)
                    html = '';
                    res.data.forEach(function (val) {
                        html+= '<p class="host" id="'+val.id+'">'+val.name+'</p>';
                    })
                    $('.searchData').html(html);
                    $('.searchData').show();
                }else{
        
                    $('#hospitalid').val(0);
                    $('.searchData').html('');
                    $('.searchData').hide();
                }
            },
            error:function(res){
                busy = false;

            }
        })
    }

    
    //模糊搜索
    $('#hospital_info').keyup(function(){
        if ($(this).val()) {
           
            searchList($(this).val());
        } else {
            $('.searchData').html('');
            $('.searchData').hide();
        }
    });

    $('.searchData').on('click','p',function(){
        if($(this).text()=='暂无医院 ,请添加此医院'){
            // $('.hand-input').val($(this).text());
            // submitData.hospitalid = $(this).attr('id');
        } else {
            choose_hospital($(this).attr('id'),$(this).text());
        }
    });
